﻿<?xml version="1.0"?>
<objects xmlns="http://www.springframework.net"
         xmlns:db="http://www.springframework.net/database">

	<object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
		<property name="ConfigSections" value="databaseSettings"/>
	</object>


	<db:provider id="DbProvider"
				 provider="SqlServer-2.0"
				 connectionString="Data Source=${db.datasource};Database=${db.database};User ID=${db.user};Password=${db.password};"/>

 
	<object id="NHibernateSessionFactory" autowire="byType" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate12">
		<property name="DbProvider" ref="DbProvider"/>
		<property name="MappingAssemblies">
			<list>
				<value>Ghasam.Business</value>
			</list>
		</property>
		<property name="HibernateProperties">
			<dictionary>

				<entry key="hibernate.connection.provider"
					   value="NHibernate.Connection.DriverConnectionProvider"/>

				<entry key="hibernate.dialect"
					   value="NHibernate.Dialect.MsSql2005Dialect"/>

				<entry key="hibernate.connection.driver_class"
					   value="NHibernate.Driver.SqlClientDriver"/>

				<entry key="hibernate.show_sql" value="true"/>
        <entry key="hibernate.use_proxy_validator" value="true"/>
				<entry key="hibernate.hbm2ddl.auto" value="validate"/>

        <entry key="hibernate.cache.provider_class"
        value="NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache" />

      </dictionary>
		</property>
	</object>

	<object id="HibernateTransactionManager" autowire="byType"
		  type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate12">
		<property name="DbProvider" ref="DbProvider"/>
		<property name="SessionFactory" ref="NHibernateSessionFactory"/>
	</object>

	<object id="hibernateTemplate" type="Spring.Data.NHibernate.HibernateTemplate" autowire="byType">
		<property name="SessionFactory" ref="NHibernateSessionFactory" />
		<property name="TemplateFlushMode" value="Commit" />
		<property name="CacheQueries" value="true" />
	</object>

	<object id="customerDao" type="Ghasam.Business.DAO.Impl.CustomerDao, Ghasam.Business" autowire="byType" singleton="true">
	</object>

	<object id="stockDao" type="Ghasam.Business.DAO.Impl.StockDao, Ghasam.Business" autowire="byType" singleton="true">
	</object>
	
	<object id="stockHistoryDao" type="Ghasam.Business.DAO.Impl.StockHistoryDao, Ghasam.Business" autowire="byType" singleton="true" >
	</object>

	<object id="stockStatusDao" type="Ghasam.Business.DAO.Impl.StockStatusDao, Ghasam.Business" autowire="byType" singleton="true">
	</object>
	
	<object id="usageDescriptionDao" type="Ghasam.Business.DAO.Impl.UsageDescriptionDao, Ghasam.Business" autowire="byType" singleton="true">
	</object>

	<object id="salesPersonDao" type="Ghasam.Business.DAO.Impl.SalesPersonDao, Ghasam.Business" autowire="byType" singleton="true">
	</object>

	<object id="accountingDao" type="Ghasam.Business.DAO.Impl.AccountingDao, Ghasam.Business" autowire="byType" singleton="true">
	</object>

	<object id="internalAccountDao" type="Ghasam.Business.DAO.Impl.InternalAccountDao, Ghasam.Business" autowire="byType" singleton="true">
	</object>

  <object id="paymentDao" type="Ghasam.Business.DAO.Impl.PaymentDao, Ghasam.Business" autowire="byType" singleton="true">
  </object>

	<object id="paymentChequeDao" type="Ghasam.Business.DAO.Impl.PaymentChequeDao, Ghasam.Business" autowire="byType" singleton="true">
	</object>

	<object id="goodsDao" type="Ghasam.Business.DAO.Impl.GoodsDao, Ghasam.Business" autowire="byType" singleton="true" />
	
	<object id="internalAccountingDao" type="Ghasam.Business.DAO.Impl.InternalAccountingDao, Ghasam.Business" autowire="byType" singleton="true" />

	<object id="internalAccountingTypeDao" type="Ghasam.Business.DAO.Impl.InternalAccountingTypeDao, Ghasam.Business" autowire="byType" singleton="true" />

	<object id="itemDao" type="Ghasam.Business.DAO.Impl.ItemDao, Ghasam.Business" autowire="byType" singleton="true" />

  <object id="invoiceDao" type="Ghasam.Business.DAO.Impl.InvoiceDao, Ghasam.Business" autowire="byType" singleton="true" />

  <object id="paymentTypeDao" type="Ghasam.Business.DAO.Impl.PaymentTypeDao, Ghasam.Business" autowire="byType" singleton="true" />

  <object id="employeeLeaveDao" type="Ghasam.Business.DAO.Impl.EmployeeLeaveDao, Ghasam.Business" autowire="byType" singleton="true" />

  <object id="employeeDao" type="Ghasam.Business.DAO.Impl.EmployeeDao, Ghasam.Business" autowire="byType" singleton="true" />

  <object id="educationDao" type="Ghasam.Business.DAO.Impl.EducationDao, Ghasam.Business" autowire="byType" singleton="true" />

  <object id="jobTitleDao" type="Ghasam.Business.DAO.Impl.JobTitleDao, Ghasam.Business" autowire="byType" singleton="true" />
  
  <object id="paymentFrequencyDao" type="Ghasam.Business.DAO.Impl.PaymentFrequencyDao, Ghasam.Business" autowire="byType" singleton="true" />

  <object id="overTimeWorkDao" type="Ghasam.Business.DAO.Impl.OverTimeWorkDao, Ghasam.Business" autowire="byType" singleton="true" />

  <object id="basicSalaryDao" type="Ghasam.Business.DAO.Impl.BasicSalaryDao, Ghasam.Business" autowire="byType" singleton="true" />
</objects>